package io.yunho.srw.lean.lambda;

/**
 * @author: Jason
 * @date: 2021/5/5 9:56
 * @description:
 */
public class ThreadDemo {
    public static void main(String[] args) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("O(∩_∩)O哈哈~");
            }
        }).start();

        //jdk lambda  是函数调用方式，需要告诉编译器返回的对象的类型
        // 返回指定接口的对象实例
        Runnable runnable = () ->
            System.out.println("O(∩_∩)O哈哈~");

        Runnable runnable2 = () ->
                System.out.println("O(∩_∩)O哈哈~");
        System.out.println(runnable==runnable2);
        new Thread(runnable).start();

    }
}
